package com.hxkj.controller.taglib;

import com.alibaba.fastjson.JSONObject;
import com.hxkj.domain.po.FreeMarker;
import com.hxkj.service.taglib.AnalyzeTagsService;
import com.integral.mall.file.po.SysFile;
import com.platform.common.domain.result.ResultDataStruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * @ClassName AnalyzeTagsController
 * @Description TODO
 * @Author Mr.zheng
 * @Date 2018/7/20 17:04
 * @Version 1.0
 */
@RestController
@RequestMapping("/analyzeTags")
public class AnalyzeTagsController {

    @Autowired
    private AnalyzeTagsService analyzeTagsService;
    /**
     * @Description analyzeTags 解析标签聚合模板页面
     **/
    @RequestMapping(value = "/tags")
    public Callable<JSONObject> analyzeTags(@ModelAttribute FreeMarker freeMarker) throws Exception{
        return () ->  analyzeTagsService.analyzeTags(freeMarker);
    }

    /**
     * @Description analyzeTagArticle 解析标签详情文章列表页面
     **/
    @RequestMapping(value = "/tagArticle")
    public Callable<JSONObject> analyzeTagArticle(@ModelAttribute FreeMarker freeMarker) throws Exception{
        return () ->  analyzeTagsService.analyzeTagArticle(freeMarker);
    }
}
